import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Management from "../views/management/Management";
import exhibitsFilling from "../views/filling/exhibitsFilling";
import exhibitorFill from "../views/filling/exhibitorFill";
import live_broadcast from "../views/live_broadcast/live_broadcast";
import addExhibits from "../views/filling/add_exhibits/index";
import on_line from "../views/Administration/on_line";
// import gantt from "../views/Administration/gantt";
import container from "../views/Administration/container";
// import live from "../views/Administration/live";
import Administration from "../views/Administration/Administration";
import online from "../views/Administration/online";
import Negotiation from "../views/Administration/Negotiation";
import lecture from "../views/Administration/lecture";
import statistics from "../views/statistics/statistics";
import application_and_management from "../views/Administration/page/application_and_management/index.vue"

Vue.use(VueRouter)
// 解决ElementUI导航栏中的vue-router在3.0版本以上重复点菜单报错问题
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push (location) {
  return originalPush.call(this, location).catch(err => err)
}
  const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    children:[
      {
        path: 'Management',
        name: 'Management',
        component: Management
      },
      {
        path: 'exhibitsFilling',
        name: 'exhibitsFilling',
        component: exhibitsFilling
      },
      {
        path:'exhibitorFill',
        name: 'exhibitorFill',
        component: exhibitorFill
      },
      {
        path:'addExhibits',
        name: 'addExhibits',
        component: addExhibits
      },
      {
        // 观众直播
        path:"live_broadcast",
        name: 'live_broadcast',
        component: live_broadcast
      },
      {
        //问卷统计
        path:"statistics",
        name: 'statistics',
        component: statistics
      },
      {
        // 申请及管理

        // path:"on_line",
        // name: 'on_line',
        // component: on_line,
        path:"application_and_management",
        name: 'application_and_management',
        component: application_and_management,
        // redirect:"lecture",
        children:[
            //讲座
          {
            path:"/lecture",
            name: 'lecture',
            component: lecture,

          },
          //线下直播
          {
            path:"/Administration",
            name: 'Administration',
            component: Administration,
          },
          //线上直播
          {
            path:"/online",
            name: 'online',
            component: online,
            // redirect:"online"
          },
          //洽谈
          {
            path:"/Negotiation",
            name: 'Negotiation',
            component: Negotiation,
          },
        ]


      },
    ]
  },


]

const router = new VueRouter({
  routes
})

export default router
